package org.refresh.core;

import java.util.List;
import java.util.Map;

import org.refresh.core.expr.BinaryExpression;
import org.refresh.core.expr.Expression;


/*******************************************************************************
 * Copyright (c) 2005 Jules White. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Common Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors: Jules White - initial API and implementation
 ******************************************************************************/
public interface RefreshCore {

	public static final String SUM_PREFIX = "sum_of_";

	public static final String PRESENCE_PREFIX = "in_solution_";

	/**
	 * @return the zeroUndefinedVariables
	 */
	public abstract boolean getZeroUndefinedVariables();

	/**
	 * @param zeroUndefinedVariables
	 *            the zeroUndefinedVariables to set
	 */
	public abstract void setZeroUndefinedVariables(
			boolean zeroUndefinedVariables);

	/**
	 * @return the maximizeOptimizationFunction
	 */
	public abstract boolean getMaximizeOptimizationFunction();

	/**
	 * @param maximizeOptimizationFunction
	 *            the maximizeOptimizationFunction to set
	 */
	public abstract void setMaximizeOptimizationFunction(
			boolean maximizeOptimizationFunction);

	/**
	 * @param optimizationFunction
	 *            the optimizationFunction to set
	 */
	public abstract void setOptimizationFunction(Expression exp);

	/**
	 * @return the useBranchAndBound
	 */
	public abstract boolean getUseBranchAndBound();

	/**
	 * @param useBranchAndBound
	 *            the useBranchAndBound to set
	 */
	public abstract void setUseBranchAndBound(boolean useBranchAndBound);

	public abstract void setSetsToMap(List srcs, List trgs);

	public abstract void setSetsToMap(Object[] srcs, Object[] trgs);

	public abstract void setTargetVariableValues(Object target, Map values);

	public abstract void setTargetVariableValues(Object target, Object[] values);

	public abstract void setSourceVariableValues(Object source, Map values);

	public abstract void setSourceVariableValues(Object source, Object[] values);

	public abstract Map<Object, List> nextMapping();

	public abstract Map<Object, List> nextMappingWithinTimeLimit(int time);

	public abstract Map<Object, List> nextMappingWithinNodeLimit(int nodes);

	public abstract void setValidTargets(Object src, List valid);

	public abstract void setInValidTargets(Object src, List invalid);

	public abstract void requireAllMapped();

	public abstract void requireAllMappedExactlyOnce();

	public abstract void addSourceMappedCardinalityConstraint(Object src,
			int min, int max);

	public abstract void addTargetMappedSourcesCardinalityConstraint(
			Object target, int min, int max);

	public abstract void addTargetMappedSourcesConstraint(Object target,
			int exactmapped);

	public abstract void addTargetIntResourceConstraint(Object target,
			Object var, int val);

	public abstract Map getTargetVariableValues(Object target);

	public abstract Map getSourceVariableValues(Object source);

	public abstract void addRequiresMappingConstraint(Object src, Object req);

	public abstract void addSelectMappingConstraint(Object src, List set,
			int min, int max);

	public abstract void addSelectMappingConstraint(Object src, List set,
			int exactcard);

	public abstract void addExcludesMappingConstraint(Object src, Object req);

	public abstract void addSourceMappingConstraint(Object src,
			BinaryExpression expression);

	public abstract void setIntVariableValue(Object variable, int value);

	public abstract void createIntVariable(Object variable, String op,
			Expression exp);

	
}